<template>
	<view class="box">
		<view class="title bold f30 f-w">
			<image src="https://jw.xzsw2021.com/static/user/icon_259@2x.png" mode=""></image>
			如何成为美食官
		</view>
		<view class="desc f28">
			<rich-text :nodes="content"></rich-text>
		</view>
		
		<view class="btn" @click="gofood" v-if="brokerage_level==1">申请成为美食官</view>
		<view class="btn" v-else>去首页购物</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				 content:'',
				 brokerage_level:''
			}
		},
		onShow() {
			this.check()
		},
		methods: {
			gofood(){
				uni.navigateTo({
					url:"./apply?type=1"
				})
			},
			// 查询是不是分销商
			check(){
			    
				this.$request('user', {}, 'GET').then(res => {
					
					this.brokerage_level = res.data.brokerage_level
					
				})
				this.getcontent()
			
				
			},		
			getcontent(){
				this.$request('cache/sys_brokerage',{},'GET').then(res=>{
                     this.content=res.data.sys_brokerage
				})
			},	
			// 去首页
			goHome(){
				uni.switchTab({
					url:'/pages/index/index'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.box{
		padding: 0 30rpx;
	}
	.title{
		margin: 63rpx 0 40rpx;
		image{
			margin-right: 14rpx;
			width: 36rpx;
			height: 36rpx;
		}
	}
	.desc{
		line-height: 46rpx;
	}
	.btn{
		position: fixed;
		bottom: 417rpx;
		left: 125rpx;
		width: 500rpx;
		height: 100rpx;
		text-align: center;
		line-height: 100rpx;
		color: #fff;
		font-size: 32rpx;
		background: linear-gradient(64deg, #2BCCA5, #22B591);
		box-shadow: 0rpx 4rpx 6rpx 0rpx rgba(20, 187, 146, 0.4);
		border-radius: 10rpx;
	}
</style>
